home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 441 / dlibs12 / sscanf.c < prev    next >
C/C++ Source or Header  |  1990-11-23  |  406b  |  28 lines

  1. #include <stdio.h>
  2.  
  3. static int sgetc(s)
  4.     unsigned char **s;
  5.     {
  6.     register unsigned char c;
  7.  
  8.     c = *(*s)++;
  9.     return((c == '\0') ? EOF : c);
  10.     }
  11.  
  12. static int sungetc(c, s)
  13.     int c;
  14.     unsigned char **s;
  15.     {
  16.     if(c == EOF)
  17.         c = '\0';
  18.     return(*--(*s) = c);
  19.     }
  20.  
  21. sscanf(buf, fmt, arg)
  22.     unsigned char *buf;
  23.     unsigned char *fmt;
  24.     int arg;
  25.     {
  26.     return(_scanf(&buf, sgetc, sungetc, fmt, &arg));
  27.     }
  28.